# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html
from distutils.tests import here

'''
Created on Dec 14, 2012
@author: blubin
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;
from unique import UNIQUE;

class CustomerApplication(RoleApplication):
    """ The Reception User Interface """

    def __init__(self):
        super(CustomerApplication, self).__init__("CallCenter"+UNIQUE, "Customer");
        self.register_source_step("EnterProblem", self.customer_enter_problem);
        self.register_source_step("AcknowledgeAnswer", self.customer_acknowledge_answer)

    def customer_enter_problem(self, stepname, form):
        print "customer: customer_enter_problem"
        form.add_html_label('<B>Enter your information:</B>')
        form.add_field(Type.SHORTSTRING, "FirstName", labeltext="First Name", initial="First");
        form.add_field(Type.SHORTSTRING, "LastName", labeltext="Last Name", initial="Last");
#        form.add_field(Type.DATE, "Birthday");
        form.add_static_label("Policy Number:");
        form.add_field(Type.SHORTSTRING, "PolicyNumber", labeltext="Policy Number");
        form.add_field(Type.SHORTSTRING, "ProblemDescription", labeltext="Problem Description");
#        form.add_field(Type.CURRENCY, "CoPay", labeltext="Co-Pay", initial=20);
    
    def customer_acknowledge_answer(self, stepname, form):
        print "customer: customer_acknowledge_answer"
        # print out solution here
        form.add_task_label(fields=["LastName", "Answer"]);
        # acknowledge answer
        form.add_field(Type.BOOLEAN, "AcknowledgeAnswer");
        
        
if __name__ == '__main__':
    app = CustomerApplication();
    app.MainLoop();